package com.webcash.CNBoard.Repository;

import java.util.HashMap;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import com.webcash.CNBoard.Model.WorkDocFileTracer;

public class WorkDocFileTracerRepositoryImpl extends SqlSessionDaoSupport implements WorkDocFileTracerRepository{

	public void insertWorkDocFileTracer(WorkDocFileTracer tracer) {
		SqlSession session = getSqlSession();
		
		session.insert("WorkDocFileTracer.insertWorkDocFileTracer", tracer);
	}

	public WorkDocFileTracer selectWorkDocFileTracerByWorkNo(int workNo) {
		SqlSession session = getSqlSession();
		
		return session.selectOne("WorkDocFileTracer.selectWorkDocFileTracerByWorkNo", workNo);
	}

	public WorkDocFileTracer selectWorkDocFileTracerByRelationNo(int relationNo2) {
		SqlSession session = getSqlSession();
		
		return session.selectOne("WorkDocFileTracer.selectWorkDocFileTracerByRelationNo", relationNo2);
	}

	public void updateWorkDocFileTracer(WorkDocFileTracer tracer) {
		SqlSession session = getSqlSession();
		
		Map map = new HashMap();
		map.put("docNo", tracer.getDocNo());
		map.put("fileNo", tracer.getFileNo());
		map.put("relationNo", tracer.getRelationNo());
		session.update("WorkDocFileTracer.updateWorkDocFileTracer", map);
	}

	public void deleteWorkDocFileTracerByRelationNo(int relationNo2) {
		SqlSession session = getSqlSession();
		
		session.delete("WorkDocFileTracer.deleteWorkFileTracerByRelationNo", relationNo2);
	}

	public void deleteWorkDocFileTracerByWorkNo(int workNo) {
		SqlSession session = getSqlSession();
		session.delete("WorkDocFileTracer.deleteWorkDocFileTracerByWorkNo", workNo);
	}
	
	
}
